home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 October / october_2001.iso / Site Building / Atomix Buttons / DATA1.CAB / Program_Executable_Files / smartj.txt < prev    next >
Encoding:
Text File  |  2000-02-14  |  13.0 KB  |  285 lines

  1. SmartJ Java launcher, version 0.51, 25 June 1999
  2.  
  3. author: Jonathan Revusky, jrevusky@bigfoot.com
  4.  
  5. SmartJ.exe and SmartJW.exe are optional replacements for the
  6. command-line java launchers java.exe and javaw.exe which come with Sun
  7. Microsystems' JRE and JDK.
  8.  
  9. SmartJC.exe provides a front-end the JDK java compiler javac.exe or the
  10. super-fast jikes compiler from IBM (separately downloadable DLL).
  11.  
  12. The difference is that the SmartJ utilities are designed to be much more
  13. newbie friendly. SmartJ.exe is a console-mode launcher, while SmartJW is
  14. the GUI launcher that, when associated with the .class extension, makes
  15. .class files double-clickable in the Windows Explorer
  16.  
  17. (See the bottom of this file for the licence and conditions of use.)
  18.  
  19. History
  20.  
  21. This is version 0.51, released on June 25, 1999.
  22. Version 0.50 was released on March 6, 1999.
  23. Version 0.44 was released on January 13, 1999
  24. Version 0.43 was released on December 18, 1998.
  25. Version 0.42 was released on December 13, 1998.
  26. Version 0.41 was released on December 9, 1998.
  27. Version 0.40 was released on December 6, 1998.
  28. Version 0.31 was released on August 1, 1998.
  29. Version 0.30 was released on July 29, 1998.
  30. Version 0.20 was released July 27, 1998.
  31. Version 0.11 was released on July 24, 1998.
  32.  
  33.  
  34. Improvements and changes in Version 0.51
  35.  
  36. Probably the biggest change going from Version 0.50 to version 0.51 is
  37. that the default is now to launch Java 1.2 if it is available. So, if you have
  38. both Java 1.2 and 1.1 runtime(s) installed, and you want to test using
  39. a 1.1 runtime, you go: smartj -1 <classfile>
  40.  
  41. The next biggest change is that smartj now works with hotspot. It didn't
  42. before. It also supports the -classic command-line option, which specifies
  43. that hotspot should NOT be used.
  44.  
  45. Also, for my fellow JPython fans, I have included a SmartJP
  46. executable which launches JPython. It snoops a bit to find your
  47. JPython install directory, basically assuming that you did the sane thing
  48. of putting it on a top-level directory that matches the pattern JPython*
  49. on one of your hard drives. If you want to bury your Jpython in a
  50. subdirectory or put it in a directory that's name does not start with JPython,
  51. you need to set the environment variable JPYTHON_HOME to where the
  52. jpython home directory is.
  53.  
  54. Last, but not least, this release allows you to define an env. variable
  55. called JARS_DIR. All .jar files in that directory get added to the classpath.
  56. A minor convenience.
  57.  
  58. In this release, I just statically compiled each exe separately rather
  59. than creating a DLL with shared code. Using a DLL sometimes causes mysterious
  60. problems which I don't understand and may (or may not) investigate. This
  61. is why the archive file is so much bigger on this version.
  62.  
  63. Improvements and changes in Version 0.50
  64.  
  65. Version 0.5 offers a much better solution for the deployment of Java
  66. applications. Executable .jar files a la Java 2 are supported. Also,
  67. a simpler scheme is supported whereby naming the .jar file the same
  68. as its main class makes the archive directly executable. By default,
  69. also, SmartJ will assume that any .jar or .zip archive files in the
  70. same directory as the executable archive are part of the same project,
  71. so it will tack them onto the classpath.
  72.  
  73. SmartJ will automatically place archive files that are in the same directory
  74. as the executable archive file on the classpath. This provides a convenient
  75. place to put third-party libraries and resources without maintaining an explicit
  76. CLASSPATH environment variable. In fact, there is the further option of
  77. putting them in a subdirectory called "lib" or "libs". Any archive file in a
  78. "lib" or "libs" subdirectory relative to the executable archive file will be
  79. placed on the classpath.
  80.  
  81. Note also that SmartJ supports the use of executable .jar files with Java 1.1
  82. or Java 1.2. As before, Java 1.1 is the default. You can specify Java 1.2 by
  83. using the -12 command-line option. (At some future point when Java 2 is more
  84. firmly established, I will likely change the default and have it search for a 1.2
  85. runtime by default. In that case, you would need to specify -11 on the
  86. command line to get java 1.1)
  87.  
  88. Other, minor improvements.
  89.  
  90. If the .class file you click on corresponds to an Applet, it can be viewed
  91. with SmartJ -- even if the Applet has no main() method and no web page is
  92. set up. SmartJ does this by instantiating a Frame and placing the Applet in
  93. the Frame's client area. Of course, the Applet has no associated AppletStub or
  94. AppletContext, so methods such as getParameter() and getCodeBase() will
  95. just throw a NullPointerException -- as is typical of when you run an Applet
  96. as a standalone application. That limitation notwithstanding, this can still
  97. be a significant convenience, particularly for developers.
  98.  
  99. The SmartJC utility now allows you to pass through jikes-specific options to the
  100. jikes compilation engine -- assuming that jikes is being used, of course. These
  101. are the options that begin with +. The most commonly desired one is probably +E,
  102. which outputs the error messages in the terser emacs format. This is a
  103. format that emacs (and most other programmer's editors) can parse, thus
  104. allowing you to click on an error message and be taken directly to the
  105. corresponding line in the source file.
  106.  
  107. Improved the feedback messages you get under some circumstances.
  108.  
  109.  
  110. Improvements and changes in Version 0.4x
  111.  
  112. Introduced support for Java 1.2 and the latest JVM from Microsoft that
  113. supports JNI. The VM to launch with can be chosen via a right-click on the
  114. classfile in the windows shell.
  115.  
  116. The SmartJC utility now can use the jikes compilation engine from IBM
  117. Alphaworks. This is a separate download. The installation routine now puts
  118. in a key so that you can right-click on a folder icon in the shell and have
  119. it recursively recompile all the java source in there.
  120.  
  121. Introduced the -p option which causes the execution to pause before exit if
  122. it is running as a console app. This is useful if you launch SmartJ or
  123. SmartJC from the windows shell and it opens a console window. Otherwise,
  124. without -p, the program runs and then immediately closes the console window,
  125. so you don't get to see any error messages.
  126.  
  127. In Java 1.2, any archive in <javahome>/lib/ext is automatically added to
  128. the classpath by default. SmartJ mimics this behavior even if you are using
  129. a 1.1 runtime. Also, as before, any jar or zip files in <javahome>/lib are
  130. automatically tacked onto your classpath. This gives you another
  131. convenient place to drop a java archive and make sure it is always
  132. on your classpath (somewhat analogous to the C:\windows\system as a place
  133. to drop .dll's). <javahome>/classes is also put on the classpath so this
  134. provides a place to put commonly used .class files.
  135.  
  136. SmartJ is now open source. A couple of people expressed interest in
  137. hacking the code and I saw no reason not to let them do so. I have nothing
  138. very organized right now. I am working up a (hopefully) enticing
  139. website. Meanwhile, if you are interested, drop me an email and I'll drop
  140. you the Object Pascal source.
  141.  
  142. Improvements and changes in Version 0.3x
  143.  
  144. Now includes something of an install program. The setup.exe
  145. copies the program files to your Windows directory. (That seems as good as
  146. any a place to put the files, simply to make sure that they are on the
  147. system PATH.) The setup program then sets up the registry key that makes
  148. .class files double-clickable.
  149.  
  150. Introduced SmartJC.exe, which is a replacement for Javac.
  151. Aside from this (which is important and IMO justifies the version number
  152. change) there is no significant change to SmartJ.exe or SmartJW.exe.
  153.  
  154. SmartJC is a drop-in replacement for Javac with the following extra
  155. features:
  156.  
  157. (1) SmartJC takes a directory as an argument, and will recompile all
  158.     out-of-date source files in the entire hierarchy.
  159.  
  160. (2) SmartJC checks whether a file is newer than its corresponding .class
  161.     file in determining whether to recompile. The -f option turns off that
  162.     check.
  163.  
  164. (3) Like its companion utilities, SmartJ and SmartJW, SmartJC also does a
  165.     "sanity" check of the Classpath before launching the JVM. Basically, it
  166.     looks in your source files to see what the package name is and sets up
  167.     the classpath in a way that makes sense. If this is impossible, it warns you.
  168.  
  169. Improvements in Version 0.2x
  170.  
  171. SmartJ now uses a DLL, jlaunch.dll.
  172. SmartJ.exe and SmartJW.exe are just stubs that call functions in the DLL.
  173. This makes the distribution smaller.
  174.  
  175. Fixed certain problems in the processing of command-line
  176. arguments. The previous version did not expand wildcards.
  177.  
  178. It now understands all the command-line options that JRE.EXE
  179. uses. As before, SmartJ tells you which JDK it is using and what classpath.
  180. This is the default behavior. However, there is now a -Q option that turns that off.
  181.  
  182. SmartJ spits out the command-line options if invoked with no parameters.
  183.  
  184. Notes:
  185.  
  186. SmartJ can be used as a drop-in replacement of the launchers in the Sun
  187. JDK and JRE. With the following caveats:
  188.  
  189. 1. Currently, SmartJ only works with Sun's JDK or JRE 1.1.x or the most
  190. recent Microsoft JVM that supports JNI. (To use the compiler utility,
  191. SmartJC, you need the Sun JDK, since the JRE does not include a compiler.
  192. SmartJ will also use the IBM Jikes compilation engine which is a
  193. separate download.)
  194.  
  195. 2. SmartJ is Win32 specific.
  196.  
  197. 3. SmartJ has a behavior that is different from the Sun JDK in that the
  198. current working directory ALWAYS has first crack. What that means is
  199. that if you go:
  200.  
  201. smartj foo
  202.  
  203. and there is a foo.class in your current directory, SmartJ will do its
  204. best to launch that class. If necessary, it will set up the classpath so
  205. as to make that possible. This differs from the Sun JDK behavior. If, for
  206. example, your classpath is defined as:
  207.  
  208. C:\jdk\lib\classes.zip;C:\myclasses;.
  209.  
  210. then the Sun JDK will launch a foo.class in C:\myclasses rather than the
  211. one in the current working directory.
  212.  
  213. The Sun JDK follows a UNIX tradition in which the current working
  214. directory is NOT on the system path by default. I feel that this, along
  215. with the case-sensitive nature of class names, has been the cause of much
  216. confusion, since in DOS/Windows, the current working directory ALWAYS
  217. takes precedence over the system path and the command shell is never picky
  218. about lower/upper case. Unlike Unix, Windows will only look for an executable
  219. on the path if it can't find it in the current directory.
  220.  
  221. Basically, in these regards, the JRE/JDK launchers (for better or worse)
  222. follow a Unix tradition, while SmartJ is consistent with the DOS/Windows
  223. tradition -- also for better or worse.
  224.  
  225. Further Notes:
  226.  
  227. SmartJ has various places for you to drop third-party libraries and
  228. resources. All archive files in the application's base path are
  229. added to the classpath. If your application's base path has a
  230. subdirectory called "lib" or "libs" all archive files in there
  231. are added to the classpath when you launch the application.
  232.  
  233. For resources that should be available globally, note that SmartJ
  234. automatically puts <javahome>\classes on the classpath,
  235. as well as any .jar or .zip file that is in <javahome>\lib or
  236. <javahome>\lib\ext. This gives you a convenient place to put
  237. any class files or jar files that you use frequently without
  238. having to maintain a classpath.
  239.  
  240. (Since SmartJ automatically adds any .zip or .jar file it finds in
  241. <javahome>\lib to the classpath, I chose to have it search for
  242. the plugin first -- if there is no JAVAI.DLL on the system path.
  243. If the plugin is installed, Swingall.jar is in the <javahome>\lib directory
  244. automatically and is thus automatically on the classpath.
  245.  
  246. If you have any questions, do not hesitate to contact me at
  247. jrevusky@bigfoot.com. Check back frequently at:
  248.  
  249. http://www.bigfoot.com/~crystalline.solutions
  250.  
  251. for the most up-to-date version of SmartJ.
  252.  
  253. SmartJ License: Free.
  254.  
  255. You may use SmartJ yourself or redistribute SmartJ to deploy your java application,
  256. commercial or otherwise, as long as you:
  257.  
  258. (1) leave the banner text (console mode) and/or about box
  259. (GUI mode) intact that indicates the author and the URL where
  260. the user may obtain the latest version of SmartJ. That URL is currently:
  261.  
  262. http://www.bigfoot.com/~crystalline.solutions.
  263.  
  264. (2) Include this readme file.
  265.  
  266. (SmartJ is copyright material and your use of it implies acceptance of the
  267. above conditions.)
  268.  
  269. My Consulting Services:
  270. (An attempt to NOT be completely non-profit. :-)
  271.  
  272. SmartJ is free and you can use it freely under the very liberal terms
  273. stated above. However, my consulting services are not free. On the one hand, I am
  274. very interested in suggestions and bug reports and even questions that can
  275. help me improve the product and documentation. On the other hand, if you do
  276. want fairly extensive help that is related to deploying your commercial
  277. Java application, where some custom version of SmartJ seems like a good
  278. solution, feel free to contact me. Note also that SmartJ is open source.
  279. If you can adapt the source code to your purposes, that is fine. However,
  280. buying a few hours of my consulting time might be your most cost-effective
  281. option.
  282.  
  283. Jonathan Revusky, June 25, 1999.
  284.  
  285.